tid=`ps -e|grep adr|awk '{print $1}'`

interval=10
hz=$(getconf CLK_TCK)

child=`ls /proc/$tid/task/`
for c in $child; do
	read utime1 stime1 < <(awk '{print $14, $15}' /proc/$tid/task/$c/stat)
	varname="time1_${c}"
	declare "$varname=$((utime1 + stime1))"
done

sleep $interval

for c in $child; do
	read utime1 stime1 < <(awk '{print $14, $15}' /proc/$tid/task/$c/stat)
	varname="time1_${c}"
	total_time=$((utime1 + stime1 - $varname))
	usage=$(echo "scale=3; $total_time / $hz / $interval * 100" | bc)
	echo $(cat /proc/$tid/task/$c/comm), $usage
done
